#!/usr/bin/env python
# chmod a+x videoslam.cfg
PACKAGE = "thermalvis"
import roslib; roslib.load_manifest("dynamic_reconfigure")
import roslib; roslib.load_manifest(PACKAGE)

# echo $PACKAGE

from dynamic_reconfigure.parameter_generator import *

gen = ParameterGenerator()

bamode_datatype = gen.enum([ 
	gen.const("dense", int_t, 0, "SBA_DENSE_CHOLESKY"),
	gen.const("sparse", int_t, 1, "SBA_SPARSE_CHOLESKY"),
	gen.const("grad", int_t, 2, "SBA_GRADIENT"),
	gen.const("block", int_t, 3, "SBA_BLOCK_JACOBIAN_PCG") ],
	"An enum to set the bundle adjustment mode")
	
gen.add("pnpIterations", int_t, 0, "Number of iterations to perform for PnP (camera pose estimation from known 3D points)", 100, 0, 1000)
gen.add("inliersPercentage", double_t, 0, "Minimum percentage of inliers to accept PnP pose as valid guide", 0.9, 0.0, 1.0)
	
gen.add("baMode", int_t, 0, "Type of BA to perform", 1, 0, 3, edit_method=bamode_datatype)
gen.add("baStep", double_t, 0, "Initial step size", 1e-4, 0.0, 1.0)

gen.add("maxAllowableError", double_t, 0, "Maximum convergence error for publishing pose", 1.0, 0.0, 100.0)

gen.add("verboseMode", bool_t, 0, "Display additional verbal info", False)
gen.add("debugMode", bool_t, 0, "Display additional debug info", False)
gen.add("debugSBA", bool_t, 0, "Display SBA debug info", False)
gen.add("debugTriangulation", bool_t, 0, "Display TRIANGULATION debug info", False)
gen.add("trimFeatureTracks", bool_t, 0, "Remove tracks and projections that are not related to keyframes", True)

gen.add("cameraLatency", double_t, 0, "Lag of camera compared with range sensor", 0.0, -1.0, 1.0)

gen.add("adjustmentFrames", int_t, 0, "Adjustment frames", 15, 1, 100)
gen.add("pairsForTriangulation", int_t, 0, "Number of frames a feature must appear in before it's triangulated", 2, 1, 100)

gen.add("dataTimeout", double_t, 0, "Time (sec) after which no data triggers program exit", 5.0, 0.0, 60.0)

gen.add("maxReprojectionDisparity", double_t, 0, "Maximum image distance between reprojection of triangulated 3D point and its 2D occurrence", 50.0, 0.0, 1000.0)

gen.add("maxDistance", double_t, 0, "Maximum distance in meters before old camera poses are discarded", 1.0, 0.0, 5.0)

gen.add("minSeparation", double_t, 0, "Minimum distance in meters between two frames to attempt a triangulation", 0.05, 0.0, 1.0)
gen.add("maxSeparation", double_t, 0, "Maximum distance in meters between two frames to attempt a triangulation", 1.0, 0.0, 5.0)
gen.add("maxStandardDev", double_t, 0, "Maximum standard deviation in meters allowable for a distribution of projected 3D points to accept a triangulation", 0.3, 0.0, 1.0)

gen.add("adjustmentIterations", int_t, 0, "Number of iterations to perform for SBA (Sparse Bundle Adjustment)", 100, 0, 1000)



exit(gen.generate(PACKAGE, "videoslam", "videoslam"))
